<?php echo $javascript->link('jquery.ui.datepicker-es'); ?>
<script>
    $(document).ready(function(){
        $(".campofecha").datepicker({
            yearRange: '2012:2013',
            showOn: 'both',
            buttonImage: './img/calendar.jpg',
            buttonImageOnly: true,
            changeYear: true,
            numberOfMonths: 1

        });
        selectDiv();
        $('#orden').change(function() {
            selectDiv();
        });
    })

</script>

<?php echo $this->Session->flash(); ?>
<?php echo $form->create('Follow', array('enctype' => 'multipart/form-data', 'type' => 'file', "action" => "edit2/" . $this->data['Follow']['id'], 'class' => 'validacion')); ?>
<?php echo $form->hidden("Follow.id"); ?>
<?php echo $form->hidden("Follow.proyect_id"); ?>
<?php echo $form->hidden("Follow.tipo", array('value' => $this->data['Follow']['tipo'])); ?>
<?php echo $form->hidden("Follow.user_id", array('value' => 0)); ?>

<table border="0" id="tabla">
    <tbody>
        <tr>
            <td>Tipo</td>
            <td><?php echo $this->data['Follow']['tipo']; ?></td>
        </tr>
        <tr>
            <td>Inicio programado</td>
            <td><?php echo $form->input("Follow.inicio_programado", array('class' => 'campofecha', 'type' => 'text', 'label' => '')); ?></td>
        </tr>
        <tr>
            <td>Inicio real</td>
            <td><?php echo $form->input("Follow.inicio_real", array('class' => 'campofecha', 'type' => 'text', 'label' => '')); ?></td>
        </tr>
        <tr>
            <td>Fin programado</td>
            <td><?php echo $form->input("Follow.fin_programado", array('class' => 'campofecha', 'type' => 'text', 'label' => '')); ?></td>
        </tr>
        <tr>
            <td>Fin real</td>
            <td><?php echo $form->input("Follow.fin_real", array('class' => 'campofecha', 'type' => 'text', 'label' => '')); ?></td>
        </tr>
        <tr>
            <td>Observación</td>
            <td><?php echo $form->input("Follow.observacion", array('label' => '', 'class' => 'txtarea')); ?></td>
        </tr>
        <?php if ($this->data['Follow']['tipo'] == 'Aprobación'): ?>
            <tr>
                <td><b>Archivo</b></td>
                <td><?php echo $form->file("Follow.archivo", array('accept' => 'zip')); ?></td>
            </tr>
            <tr>
                <td>Área (ha)</td>
                <td><?php echo $form->input("Follow.area", array('label' => '')); ?></td>
            </tr>
        <?php endif ?>
    </tbody>
</table>

<?php echo $form->end('Guardar'); ?>

<table width="100%" border="0"  CellSpacing=10  align="center" >
    <tbody>
        <tr>          
            <td><?php echo $ajax->link($html->image('regresar.gif', array('width' => '30', 'heigth' => '30', 'alt' => 'Regresar', 'title' => 'regresar')), array('controller' => 'Follows', 'action' => 'index'), array('update' => 'content', 'indicator' => 'loading', 'escape' => false)); ?></td>
        </tr>
    </tbody>
</table>